package cn.cloud.all.security.oauth2.client.token;

import cn.cloud.all.security.core.Authentication;
import cn.cloud.all.security.oauth2.resource.OAuth2ProtectedResourceDetails;

/**
 * @author Dave Syer
 */
public interface ClientKeyGenerator {

    /**
     * @param resource       a protected resource declaration
     * @param authentication a user Authentication (possibly null)
     * @return a unique key identifying an access token for this pair
     */
    String extractKey(OAuth2ProtectedResourceDetails resource, Authentication authentication);

}
